package com.erp.myAdapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.erp.R;

import java.util.List;

/**
 * Created by Administrator on 2016/12/29/029.
 * 作者：刘洋
 */
public class GvfileAdapter extends BaseAdapter {
    private List<String> mlist;
    private Context mcontext;
    private LayoutInflater minflater;
    public GvfileAdapter(List<String> list,Context context){
        super();
        this.mlist=list;
        this.mcontext=context;
        this.minflater=LayoutInflater.from(context);
    }
    @Override
    public int getCount() {
        return mlist.size();
    }

    @Override
    public Object getItem(int position) {
        return mlist.get(position);
    }

    @Override
    public long getItemId(int position) {
        return position;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        convertView=minflater.inflate(R.layout.lv_tv_item,null);
        TextView tv= (TextView) convertView.findViewById(R.id.tv_lv_item);
        String[] ss=mlist.get(position).split("/");
        tv.setText(ss[ss.length-1]);
        return convertView;
    }
    public  void Allnotify(List<String> list){
        this.mlist=list;
        notifyDataSetChanged();
    }
}
